﻿<UserControl x:Class="Microsoft.EnhancedReminders.OutlookAddIn.StatusControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:common="clr-namespace:Microsoft.EnhancedReminders;assembly=Microsoft.EnhancedReminders.Common"
    xmlns:properties="clr-namespace:Microsoft.EnhancedReminders.Properties"
    xmlns:ds="clr-namespace:Microsoft.EnhancedReminders.OutlookAddIn"
    Height="Auto" Width="Auto">

    <UserControl.Resources>

        <Style x:Key="CheckboxStyle">
            <Setter Property="CheckBox.HorizontalAlignment" Value="Left"></Setter>
            <Setter Property="CheckBox.VerticalAlignment" Value="Center"></Setter>
            <Setter Property="CheckBox.Command" Value="{x:Static ds:StatusControl.CheckBoxCommand}"></Setter>
        </Style>
        
        <Style x:Key="ImageStyle">
            <Setter Property="Image.Margin" Value="5,0,0,0"></Setter>
            <Setter Property="Image.Width" Value="15"></Setter>
            <Setter Property="Image.Height" Value="15"></Setter>
        </Style>
        
        <Style x:Key="TextBlockStyle">
            <Setter Property="TextBlock.Margin" Value="5,0,0,0"></Setter>
            <Setter Property="TextBlock.HorizontalAlignment" Value="Center"></Setter>
            <Setter Property="TextBlock.VerticalAlignment" Value="Center"></Setter>
        </Style>

    </UserControl.Resources>

    <!-- Command bindings for checking/unchecking each checkbox. -->
    <UserControl.CommandBindings>
        <CommandBinding Command="{x:Static ds:StatusControl.CheckBoxCommand}"
            Executed="CheckStatusCheckbox" CanExecute="CheckStatusCheckboxCanExecute"/>
    </UserControl.CommandBindings>
    
    <Grid>
        <Grid.ColumnDefinitions >
            <ColumnDefinition />
            <ColumnDefinition Width="50"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <CheckBox Grid.Column="0" Grid.Row="0" Name="checkBoxAvailable" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.Available}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateAvailable}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="0" Grid.Row="2" Name="checkBoxBusy" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.Busy}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateBusy}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="0" Grid.Row="4" Name="checkBoxMeeting" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.InAMeeting}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateInAMeeting}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="0" Grid.Row="6" Name="checkBoxCall" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.InACall}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateInACall}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="0" Grid.Row="8" Name="checkBoxConference" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.InAConference}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateInAConference}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="0" Grid.Row="10" Name="checkBoxDoNotDisturb" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.DoNotDisturb}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateDoNotDisturb}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="2" Grid.Row="0" Name="checkBoxBeRightBack" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.BeRightBack}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateBeRightBack}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="2" Grid.Row="2" Name="checkBoxAway" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.Away}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateAway}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="2" Grid.Row="4" Name="checkBoxInactive" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.IdleOnline}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateIdleOnline}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="2" Grid.Row="6" Name="checkBoxIdleBusy" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.IdleBusy}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateIdleBusy}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="2" Grid.Row="8" Name="checkBoxOffline" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.Offline}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateOffline}"></TextBlock>
            </DockPanel>
        </CheckBox>

        <CheckBox Grid.Column="2" Grid.Row="10" Name="checkBoxUnknown" Style="{StaticResource CheckboxStyle}" Tag="{x:Static common:PresenceStates.Unknown}">
            <DockPanel>
                <Image Style="{StaticResource ImageStyle}"></Image>
                <TextBlock Style="{StaticResource TextBlockStyle}" Text="{x:Static properties:Resources.PresenceStateUnknown}"></TextBlock>
            </DockPanel>
        </CheckBox>
    </Grid>

</UserControl>
